/*
 * $Id: DummyTask.java,v 1.5 2009/09/02 22:43:04 navdeep_mahajan Exp $
 * 
 * Copyright (C) 2006 General Electric Company. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information of the General
 * Electric Company (GE). You shall not disclose this software and shall use it
 * only in accordance with the terms of the license agreement you entered into
 * with GE.
 * 
 * GE MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT. GE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 * AS A RESULT OF USING, MODIFYING, OR DISTRIBUTING THIS SOFTWARE OR ITS
 * DERIVATIVES.
 */
package com.ge.healthcare.autosc.processor.dispatcher.tasks;

import com.ge.healthcare.autosc.common.ASCLogger;
import com.ge.healthcare.autosc.common.database.pojo.ActTask;
import com.ge.healthcare.autosc.common.util.ApplicationInfo;
import com.ge.healthcare.autosc.common.util.PropertyConstants;

/**
 * Purpose - The class will be used in production to actually test that the
 * entire flow through of the requests is working without actually executing any
 * task
 * 
 * @author 212042764
 * 
 */
public class DummyTask extends BasicTask {

	private int iCount = 0;

	/**
	 * 
	 */
	public DummyTask() {
		super();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.ge.healthcare.autosc.processor.dispatcher.tasks.BasicTask#executeTask
	 * (com.ge.healthcare.autosc.common.database.pojo.ActTask)
	 */
	@Override
	public void executeTask(ActTask actTask) {
		String methodName = "executeTask";
		ASCLogger.info(this.getClass(), methodName, "Received task " + actTask
				+ " frowarding to dispatcher, iCount:" + iCount++);
		Long sleepTime = ApplicationInfo.getInstance().getLongPropertyValue(
				PropertyConstants.DUMMY_TASK_SLEEP_TIME, "52");
		try {
			Thread.sleep(sleepTime);
		} catch (InterruptedException e) {
			ASCLogger.info(this.getClass(), methodName,
					"Dummy task failed to sleep. Exception:" + e, e);
		}
	}

	/**
	 * @return the iCount
	 */
	public int getICount() {
		return iCount;
	}
}
